<form class="validform" method="post" action="/budget/add/">
    <table class="data list" cellpadding="0" cellspacing="1" style="">
        <tbody>
            <tr>
                <th>类别</th>
                <th><?= $prevmonth ?>月实际</th>
                <th><?= $prevmonth ?>月预算</th>
                <th><?= $currmonth ?>月实际</th>
                <th><?= $currmonth ?>月预算</th>
                <th>
        <div class="btn-group">
            <a class="dropdown-toggle" data-toggle="dropdown" data-icon="ok" data-event="console.log" href="#">操作 <span class="caret"></span></a>
        </div>
        </th>
        </tr>
        <?php foreach ($out as $k => $v) { ?>
            <tr>
                <td><?= $v['name'] ?></td>
                <td><?= isset($real['expense'][$prevmonth][$v['id']]) ? $real['expense'][$prevmonth][$v['id']] : 0; ?></td>
                <td><?= isset($budget['expense'][$prevmonth][$v['id']]) ? $budget['expense'][$prevmonth][$v['id']] : 0; ?></td>
                <td><?= isset($real['expense'][$currmonth][$v['id']]) ? $real['expense'][$currmonth][$v['id']] : 0; ?></td>
                <td><input type="text" name="expense[<?= $v['id'] ?>]" class="input" style="width:70px;" value="<?= isset($budget['expense'][$currmonth][$v['id']]) ? $budget['expense'][$currmonth][$v['id']] : 0; ?>" /></td>
                <td width="125">
                    <button type="button" class="btn btn_g_s copyone" rel="<?= $v['id'] ?>"><span><em>复制上月</em></span></button>
                    <button type="button" class="btn btn_w_s clearone" rel="<?= $v['id'] ?>"><span><em>清空</em></span></button>
                </td>
            </tr>
        <?php } ?>
        <tr>
            <td colspan="6"><button type="submit" class="btn btn_g_s submit"><span><em>保存本月</em></span></button>
                <button type="button" class="btn btn_g_s copyall"><span><em>复制上月</em></span></button>
                <span class="poststate"><em>&nbsp;</em><b></b></span>
            </td>
        </tr>
        </tbody>
    </table>
</form>
<script type="text/javascript">
    KS.common.load('budget.edit');
</script>